<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        class Person{
            constructor(name,age,sex){
                this.name=name;
                this.age=age;
                this.sex=sex;
            }
            run(){
                console.log("父类的run");
            }
        }

        class Student extends Person{
            constructor(num,name,age,sex){
                super(name,age,sex)
                this.num=num;
            }
        }

        var stu=new Student(2421,"哈利波特",12,"男");
        console.log(stu.name);
        stu.run();
        console.log(stu);
    </script>
</body>
</html>